<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
<title>코오롱</title>
<link rel="stylesheet" type="text/css" href="${requestScope.contextPath}/css/import.css" />
<script type="text/javascript" src="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="${requestScope.contextPath}/js/common.js"></script>
<c:set var="userAgent" value="${header['User-Agent']}" />
<fmt:setBundle basename="com.kolon.config.properties.config" var="config" />
<c:if test="${fn:indexOf(userAgent, 'Android') != -1}"><c:set var="platForm" value="Android" /></c:if>
<c:if test="${fn:indexOf(userAgent, 'iPhone') != -1}"><c:set var="platForm" value="iPhone" /></c:if>

<script type="text/javascript">
	function appBack() {
		document.location.href='#';
	}
</script>

<script type="text/javascript" src="${requestScope.contextPath}/js/cubiq-iscroll/iscroll.js"></script>
<script type="text/javascript">
	var myScroll;
	function loaded() {
		myScroll = new iScroll('wrapper', { 
			checkDOMChanges: true,
			zoom: false
		});
	<c:if test="${param.endY != null and param.endY != ''}">
		myScroll.scrollTo(0, ${param.endY}, 0);
		endY = ${param.endY};
	</c:if>
	}
	document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
	window.addEventListener('DOMContentLoaded', setTimeout(function () { loaded(); }, 200), false);

	function newMore(){
		
		var currCnt = ${mapList2.CurrPage}*${mapList2.OnePageCnt};
		var tot = ${mapList2.TotalRecordCnt};
		
		//alert(currCnt);
		if (currCnt > tot) {
			$('.more11').html('없음');
			return;
		}
		
		var nParm = "?strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page+1}&endY="+endY;
		location.href='${requestScope.contextPath}/business/mKolonInt/mKolonIntList.do'+nParm;
		
		}

	function newMore_noUSE() {
		currCnt = (page-1) * 15;
		if (currCnt > tot) {
			$('.more11').html('없음');
			return;
		}
		//showMask();
		$.ajax({
			url: '${requestScope.contextPath}/business/mKolonInt/mKolonIntListMore.do',
			type:'POST',
			data: {
				'Page': page
			},
			dataType:'json',
			success: function(json){
				for (i=0,cnt=json.list.length; i<cnt; i++) {
					obj = json.list[i];
					if(obj.Ref_Level == 1) {
						$('#news').append('<li><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD='+obj.ArticleCD+'"><span class="bold">'+obj.Title+'</span><span class="date1">'+obj.UserName+' | '+obj.UCreateDate+' | 조회 : '+obj.ViewCnt+' | 추천 : '+obj.Point+'</span></a><span class="ripple_bg"><a href="/business/mKolonInt/mKolonIntComent.do?ArticleCD='+obj.ArticleCD+'">댓글:'+obj.CommentCNT+'</a></span></li>');
					}else{
						$('#news').append('<li><ul class="int_ripple"><li><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD='+obj.ArticleCD+'"><span class="bold">'+obj.Title+'</span><span class="date1">'+obj.UserName+' | '+obj.UCreateDate+' | 조회 : '+obj.ViewCnt+' | 추천 : '+obj.Point+'</span></a><span class="ripple_bg"><a href="/business/mKolonInt/mKolonIntComent.do?ArticleCD='+obj.ArticleCD+'">댓글:'+obj.CommentCNT+'</a></span></li></ul></li>');
					}
				}
				page++;
				myScroll.isReady();
			},
			error: function(){
				alert('error');
			}
		});
	}
</script>
<style type="text/css" media="all">
/*원본 : #wrapper { position:absolute; z-index:1; top:47px; bottom:0px; left:0; width:320px;  overflow:auto; }*/
#wrapper { position:absolute; z-index:1; top:47px; bottom:0px; left:0; width:100%;  overflow:auto; }
#scroller { position:absolute;  -webkit-tap-highlight-color:rgba(0,0,0,0); width:100%; padding:0; background:#fff; }
</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>코오롱지식인</h1>
			<p class="list"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntSearchList.do"><img src="${requestScope.contextPath}/images/btn/btn_search3.gif" alt="검색" /></a></p>
		</div><!-- // header -->
		<div id="wrapper" class="content">
			<div id="scroller">
				<div class="know_frm">
					<form action="" method="post">
						<fieldset>
							<a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntWrite.do"><img src="${requestScope.contextPath}/images/btn/btn_q.gif" alt="질문하기" /></a>
						</fieldset>
					</form>
				</div><!-- // know_frm -->
				<div class="news knowledge">
					<ul id="news">
					<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
						<li>
						<c:choose>
	       					<c:when test="${mapInfo.Ref_Level == 1}">
								<a href="javascript:goUrl('${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD=${mapInfo.ArticleCD}&strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page}&endY='+endY);"><span class="bold list1">${mapInfo.Title}</span><span class="date1" style="letter-spacing:-1px; ">${mapInfo.UserName} | ${mapInfo.UCreateDate} | 조회 : ${mapInfo.ViewCnt} | 추천 : ${mapInfo.Point}</span></a><span class="ripple_bg"><a href="javascript:goUrl('${requestScope.contextPath}/business/mKolonInt/mKolonIntComent.do?ArticleCD=${mapInfo.ArticleCD}&endY='+endY);">댓글:${mapInfo.CommentCNT }</a></span>
							</c:when>
							<c:otherwise>
								<ul class="int_ripple">
									<li>
										<a href="javascript:goUrl('${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD=${mapInfo.ArticleCD }&strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page}&endY='+endY);"><span class="bold list2">${mapInfo.Title}</span><span class="date1" >${mapInfo.UserName} | ${mapInfo.UCreateDate} | 조회 : ${mapInfo.ViewCnt} | 추천 : ${mapInfo.Point}</span></a><span class="ripple_bg1"><a href="javascript:goUrl('${requestScope.contextPath}/business/mKolonInt/mKolonIntComent.do?ArticleCD=${mapInfo.ArticleCD}&endY='+endY);">댓글:${mapInfo.CommentCNT }</a></span>
									</li>
								</ul>
							</c:otherwise>
						</c:choose>
						</li>
					</c:forEach>
					</ul>
					<div class="btn_more11">
						<p class="more11"><a href="javascript:newMore();">15개 더보기</a></p>
						<p class="more22"><a href="javascript:myScroll.scrollTo(0, 0, 0);"><img src="${requestScope.contextPath}/images/news/btn_top.gif" alt="맨위로" />&nbsp;&nbsp;맨위로</a></p>
					</div>
				</div>
			</div><!-- // content -->
		</div>
	</div><!-- // wrap -->
	<script>
		window.HybridApp.clearAllHistory(); 
	</script>
</body>
</html>
